<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false"%>

<html>
<head>
<script type="text/javascript">
function cookie(hash) {
	var message = 'TREHASH_' + hash;
	if (typeof (window.postMessage) !== "undefined") {
		parent.postMessage(message, "*")
	} else {
		parent.location.hash = message;
	}
	;
}
function reloadParent() {
	var message = 'LOGINCOMPLETE';
	if (typeof (window.postMessage) !== "undefined") {
		parent.postMessage(message, "*")
	} else {
		parent.location.hash = message;
	};
}
function load(){
	cookie('${user.uuid}');
}
</script>

</head>
<body style="background-color: white;">
	<h2>loggedin ${user.loggedin}</h2>
	<form method="post" action="logout">
		Email: ${user.username}
		Password:${user.password}
		UUID: ${user.uuid}
		<input type="submit" value="logout" name="submit" />
	</form>
</body>

<script type="text/javascript">
${user.alreadyLoggedIn ? "" : "load();reloadParent();"}
</script>

</html>
